package com.itheima.d4_enum;

import lombok.Data;
import lombok.ToString;

@Data
public class Student {
    private String name;
    private int age;
    private Sex sex;
    private int[] ints;

    public Student(String name, int age, Sex sex) {
        this.name = name;
        this.age = age;
        this.sex = sex;
    }

    //深克隆

/*    @Override
    protected Object clone() throws CloneNotSupportedException {
        Student s =(Student) super.clone();
        s.ints = s.ints.clone();
        return s;
    }*/

    //浅克隆
    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    public Student() {
    }

    @Override
    public String toString() {
        return "姓名：" + name + ", 年龄：" + age + ", 性别：" + sex.getDevc();
    }
}
